home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14528 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  56 lines

  1. Path: www.rpa.net!news
  2. From: Fred Mellender <fredm@rpa.net>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: BC++5.0 Great! <NOT>
  5. Date: Sun, 31 Mar 1996 06:32:19 -0500
  6. Organization: Rochester Public Access, Inc.
  7. Message-ID: <315E6D43.2E0C@rpa.net>
  8. References: <315BEEBB.1261@mailport.delta-air.com>
  9. NNTP-Posting-Host: pm1-ip52.rpa.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (Win95; I)
  14.  
  15. I had no difficulty getting the pgm below to compile (and run).  I 
  16. suspect Mr. Sadler left off the "std::" qualification, which would
  17. give an error which reads:
  18.     "Use qualified name to access member type 'std::string' "
  19. which is pretty clear.
  20.  
  21. Regards,
  22.         --
  23. #include <string>
  24. #include <iostream.h>
  25. #include <stdio.h>
  26.  
  27. int main(void)
  28. {
  29.    std::string s1("hello world");
  30.    cout << s1 << endl;
  31.    getchar();
  32.    return (0);
  33. }
  34.     ---
  35.  
  36. William E. Sadler wrote:
  37. > Try this one folks:
  38. > do the standard hello world:
  39. > main()
  40. > {
  41. >         cout << "Hello, World" << endl;
  42. > }
  43. > This will compile.  Now, include the STL routine for a string, and cout the
  44. > string that contains hello world.  No dice.
  45. > Sad, isn't it.  I sold a 1000 shares of borland yesterday.  Happy!  I
  46. > doubled my money.  But when word abou this buggy compiler gets out in the
  47. > mainstream 'puter press, I betcha they're gonna tumble.
  48. > I've loved borland, but they've finally driven me to MSVC.  Sigh...
  49. >
  50.